package cn.tedu.store.mapper;

import cn.tedu.store.entity.Cart;
import cn.tedu.store.vo.CartVO;
import com.baomidou.dynamic.datasource.annotation.DS;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
@DS("master")
@Mapper
public interface CartMapper {
	
	Integer insert(Cart cart);
	
	Integer updateNum(
            @Param("cid") Integer cid,
            @Param("num") Integer num,
            @Param("modified_user") String modified_user,
            @Param("modified_time") Date modified_time
    );

	Cart findByUidAndGid(
            @Param("uid") Integer uid,
            @Param("gid") Long gid
    );
			
	List<CartVO> findByUid(Integer uid);
	
	Cart findByCid(Integer cid);
	
	List<CartVO> findByCids(Integer cids[]);
}
